import 'dart:io';

import 'package:flutter/material.dart';
// 加载单词文本
Future<List<String>> loadWords(String path) async{
  var file = File(path);
  var str = await file.readAsString();
  var wordList = str.split(RegExp(r'\s'));
  return wordList;
}

// 写入单词文本
Future<File> storeWords(String path, List<String> result) async{
  var file = File(path);
  return file.writeAsString(result.join('\n'));
}